<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                <!--<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />-->
                <style type="text/css">
                        body, html,#allmap {
                                width: 100%;
                                height: 100%;
                                /*overflow: hidden;*/
                                margin:0;
                                font-family:"微软雅黑";
                        }
                </style>
                <link href="__PUBLIC__/css/select.css" rel="stylesheet" type="text/css" />
                <link href="__PUBLIC__/css/style.css" rel="stylesheet" type="text/css" />
                <link href="__PUBLIC__/css/jRating.jquery.css" rel="stylesheet" type="text/css" />
                <script type="text/javascript" src="__PUBLIC__/js/jquery-1.9.0.min.js"></script>
                <script type="text/javascript" src="__PUBLIC__/js/jquery.idTabs.min.js"></script>
                <script type="text/javascript" src="__PUBLIC__/js/select-ui.min.js"></script>
                <script type="text/javascript" src="__PUBLIC__/js/editor/kindeditor.js"></script>
                <script type="text/javascript" src="__PUBLIC__/js/layer/layer.js"></script>
                <script type="text/javascript" src="__PUBLIC__/js/laydate/laydate.js"></script>
                <script type="text/javascript" src="__PUBLIC__/js/swfobject.js"></script>
                <script type="text/javascript" src="__PUBLIC__/js/jRating.jquery.js"></script>
                <script type="text/javascript" charset="utf-8" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
                <script type="text/javascript" charset="utf-8" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
                <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=7YWz04VGx8yQmsUTtmKzynSi"></script>

                <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
                <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
                <script type="text/javascript" charset="utf-8" src="__PUBLIC__/js/ueditor/lang/zh-cn/zh-cn.js"></script>
                <script type="text/javascript">
                        $(function() {
                                //实例化编辑器
                                //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
                                // var ue = UE.getEditor('editor');
                                var ue = UE.getEditor('editor');

                                $("#allmap").hide();
                                $("#tab3li").click(function() {
                                        $("#allmap").show();
                                });
                                $("#tab1li").click(function() {
                                        $("#allmap").hide();
                                });
                                $("#tab2li").click(function() {
                                        $("#allmap").hide();
                                });
                                $("#tab4li").click(function() {
                                        $("#allmap").hide();
                                });
                                //$('.basic').jRating();
                                $('.exemple3').jRating({
                                        showRateInfo: false,
                                        //step: true,
                                        //length: 10,
                                        //canRateAgain: false,
                                        //decimalLength: 2,
                                        onSuccess: function() {
                                                layer.msg('Success : 保存成功 :)');
                                        },
                                        onClick: function(element, rate) {
                                                layer.msg(rate);
                                        },
                                        onError: function(element, rate) {
                                                layer.msg(rate);
                                        }
                                });
                        });
                </script>
                <title>浏览器定位</title>
        </head>
        <body>
                <div class="place">
                        <span>位置：</span>
                        <ul class="placeul">
                                <li><a href="#">首页</a></li>
                                <li><a href="#">钓场管理</a></li>
                                <li><a href="#">钓场列表</a></li>
                                <li><a href="#">添加钓场</a></li>
                        </ul>
                </div>
                <div class="formbody">
                        <div id="usual1" class="usual"> 

                                <div class="itab">
                                        <ul> 
                                                <li><a href="#tab1" id='tab1li' class="selected">钓场信息</a></li> 
                                                <li><a href="#tab2" id='tab2li'>钓场信息</a></li> 
                                                <li><a href="#tab3" id='tab3li'>钓场位置</a></li> 
                                                <li><a href="#tab4" id='tab4li'>钓场简介</a></li> 
                                        </ul>
                                </div> 

                                <div id="tab1" class="tabson">

                                        <div class="formtext">
                                                Hi，<b>admin</b>，欢迎使用！
                                        </div>

                                        <ul class="forminfo">
                                                <li>
                                                        <label>钓场名<b>*</b></label>
                                                        <input name="" type="text" class="dfinput" style="width:518px;"/>
                                                </li>
                                                <li>
                                                        <label>钓场类型<b>*</b></label>
                                                        <input name="" type="text" class="dfinput" style="width:518px;"/>
                                                </li>


                                                <li>
                                                        <label>&nbsp;</label>
                                                        <input name="" type="button" class="scbtn" value="提交"/>
                                                </li>
                                        </ul>

                                </div> 
                                <div id="tab2" class="tabson">
                                        <ul class="forminfo">
                                                
                                                <li>
                                                        <label>星级<b>*</b></label>
                                                        <!--<input name="" type="text" class="dfinput" style="width:518px;"/>-->
                                                        <div class="exemple3" data-average="10" data-id="3"></div>
                                                </li>
                                                <li>
                                                        <label>价格<b>*</b></label>  
                                                        <input name="" type="text" class="dfinput" style="width:518px;"/>

                                                </li>

                                                <li>
                                                        <label>鱼种<b>*</b></label>  
                                                        <input name="" type="text" class="dfinput" style="width:518px;"/>

                                                </li>

                                                <li>
                                                        <label>老板<b>*</b></label>
                                                        <input name="" type="text" class="dfinput" style="width:518px;"/>
                                                </li>
                                                <li>
                                                        <label>电话<b>*</b></label>
                                                        <input name="" type="text" class="dfinput" style="width:518px;"/>
                                                </li>
                                                <li>
                                                        <label>&nbsp;</label>
                                                        <input name="" type="button" class="scbtn" value="提交"/>
                                                </li>
                                        </ul>
                                </div>
                                <div id="tab3" class="tabson">
                                        <ul class="seachform">
                                                <li>
                                                        <label>地址</label>  
                                                        <input name="fishery_address" type="text" class="dfinput" style="width:318px;"/>
                                                </li>
                                                <li>
                                                        <label>经度</label>  
                                                        <input name="fishery_longitude" type="text" class="scinput" />
                                                </li>
                                                <li>
                                                        <label>纬度</label>  
                                                        <input name="fishery_latitude" type="text" class="scinput" />
                                                </li>

                                                <li>
                                                        <label>&nbsp;</label><input name="" type="button" class="scbtn" value="提交"/>
                                                </li>

                                        </ul>
                                </div>
                                <div id="tab4" class="tabson">
                                        <ul class="forminfo">
                                                <form action="server.php" method="post">
                                                        <li>
                                                                <!--<label>钓场简介<b>*</b></label>-->
                                                                <!--<textarea id="content7" name="content" style="width:700px;height:250px;visibility:hidden;"></textarea>-->
                                                                <!--<div>-->
                                                                <script id="editor" type="text/plain" style="width:1024px;height:300px;"></script>
                                                                <!--</div>-->
                                                        </li>
                                                        <li>
                                                                <label>&nbsp;</label>
                                                                <input name="" type="submit" class="scbtn" value="提交"/>
                                                        </li>
                                                </form>
                                        </ul>
                                </div>
                        </div> 

                        <script type="text/javascript">
                                /*                        
                                 KE.show({
                                 id: 'content7',
                                 cssPath: './index.css'
                                 });
                                 */
                                $("#usual1 ul").idTabs();
                                $('.tablelist tbody tr:odd').addClass('odd');
                                $(".select1").uedSelect({
                                        width: 345
                                });
                                $(".select2").uedSelect({
                                        width: 100
                                });
                                $(".select3").uedSelect({
                                        width: 200
                                });
                                                        </script>
                </div>
                <div id="allmap"></div>
        </body>
</html>
<script type="text/javascript">
        // 百度地图API功能
        var map = new BMap.Map("allmap");
        var geoc = new BMap.Geocoder();
        var mk = null;
        map.enableScrollWheelZoom(); //启用滚轮放大缩小，默认禁用
        map.enableContinuousZoom(); //启用地图惯性拖拽，默认禁用
        map.addControl(new BMap.NavigationControl()); // 添加平移缩放控件
        map.addControl(new BMap.ScaleControl()); // 添加比例尺控件
        map.addControl(new BMap.OverviewMapControl()); //添加缩略地图控件
        map.enableScrollWheelZoom(); //启用滚轮放大缩小
        map.addControl(new BMap.MapTypeControl()); //添加地图类型控件
        map.disable3DBuilding();
        //单击获取点击的经纬度
        map.addEventListener("click", function(e) {
                //alert(e.point.lng + "," + e.point.lat);
                $("input[name='fishery_longitude']").val(e.point.lng);
                $("input[name='fishery_latitude']").val(e.point.lat);
                if(mk != null){
                        map.removeOverlay(mk);
                }
                mk = new BMap.Marker(e.point);
                //map.panTo(e.point);
                map.addOverlay(mk);
                var pt = e.point;
                geoc.getLocation(pt, function(rs) {
                        var addComp = rs.addressComponents;
                        //layer.msg(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
                        var address = addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber;
                        $("input[name='fishery_address']").val(address);
                });
        });
        //初始点为北京
        var point = new BMap.Point(116.331398, 39.897445);
        map.centerAndZoom(point, 12);
        var geolocation = new BMap.Geolocation();
        geolocation.getCurrentPosition(function(r) {
                if (this.getStatus() == BMAP_STATUS_SUCCESS) {
                        mk = new BMap.Marker(r.point);
                        map.addOverlay(mk);
                        map.panTo(r.point);
                        //alert('您的位置：' + r.point.lng + ',' + r.point.lat);
                        $("input[name='fishery_longitude']").val(r.point.lng);
                        $("input[name='fishery_latitude']").val(r.point.lat);
                        var pt = r.point;
                        geoc.getLocation(pt, function(rs) {
                                var addComp = rs.addressComponents;
                                //layer.msg(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
                                var address = addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber;
                                $("input[name='fishery_address']").val(address);
                        });
                }
                else {
                        alert('failed' + this.getStatus());
                }
        }, {enableHighAccuracy: true})
        //关于状态码
        //BMAP_STATUS_SUCCESS	检索成功。对应数值“0”。
        //BMAP_STATUS_CITY_LIST	城市列表。对应数值“1”。
        //BMAP_STATUS_UNKNOWN_LOCATION	位置结果未知。对应数值“2”。
        //BMAP_STATUS_UNKNOWN_ROUTE	导航结果未知。对应数值“3”。
        //BMAP_STATUS_INVALID_KEY	非法密钥。对应数值“4”。
        //BMAP_STATUS_INVALID_REQUEST	非法请求。对应数值“5”。
        //BMAP_STATUS_PERMISSION_DENIED	没有权限。对应数值“6”。(自 1.1 新增)
        //BMAP_STATUS_SERVICE_UNAVAILABLE	服务不可用。对应数值“7”。(自 1.1 新增)
        //BMAP_STATUS_TIMEOUT	超时。对应数值“8”。(自 1.1 新增)
</script>
